var path = require('path');
var fs = require('fs');

module.exports = {
    db: {
        name: 'mysql',
        username: 'bian',
        pwd: 'Bln12345',
        //pwd: 'ziyun!@2015',
        //pwd: '654321',
        //host: '139.129.18.214',
        //host: '123.57.249.210',
        //host: '182.92.203.172',
        //host: '123.57.152.197',
        //host: '172.6.2.65',
        //host:'139.129.42.180',
        host:'127.0.0.1',
        database: 'maker',
        toString() {
            return `${this.name}://${this.username}:${this.pwd}@${this.host}/${this.database}`;
        }
    },
    redis: {
        port: '6379',
        host: '127.0.0.1',
        pwd: ''
    },
    log: {
        _dir: undefined,
        dir()  {
            if (!this._dir) {
                this._dir = path.join(__dirname, '..', 'log');
            }
            return this._dir;
        },
        access() {
            return path.join(this.dir(), 'acces.log');
        },
        error() {
            return path.join(this.dir(), 'error.log');
        }
    },
    root: __dirname + '/../',
    wechat: {
        ////appId: 'wxf4ec3e373279f1b2',
        ////secret: 'd4624c36b6795d1d99dcf0547af5443d',
        //appId: 'wx07f11a5bc7b968d3',
        //secret: 'e3aa5a9929b02d4a9cbe77bf60fb70c0',
        //token: 'FoodMarket',
        //mchId: '1302722701',
        //partnerKey: 'taichangkejixiaodizhu00000000000',
        //pfx: fs.readFileSync('./scripts/certs/apiclient_cert.p12'),
        ////domain: 'http://www.xdz365.cn'
        //domain: 'http://www.tc2004.com',
        ////encodingAESKey: 'eviH4dhrypm4yRDP7TyjpghPDLY0I7qTwjMoJn4MPas'
    }
};
